<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="新增ERP人事报销" bodyClass="white-bg"/>
<div class="wrapper wrapper-content ibox-content">
    <@form.form id="form-reimburse-add"  class="form-horizontal">
    <input name="id" value="${bpmErpPersonReimburse.id}" type="hidden">
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "流水号"/>：
    </label>
        <div class="col-sm-8"><input name="serialNumber" value="${bpmErpPersonReimburse.serialNumber?default('')}" class="form-control" type="text" readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "申请人"/>：
    </label>
        <div class="col-sm-8"><input name="applyUsername" value="${bpmErpPersonReimburse.applyUsername?default('')}" class="form-control" type="text" readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "费用发生日期"/>：</label>
        <div class="col-sm-8">
            <div class="input-group date">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input class="form-control" name="reimburseCostTime"  data-type="date"   value="${(bpmErpPersonReimburse.reimburseCostTime?string('yyyy-MM-dd'))!}" data-format="yyyy-MM-dd" type="text"  readonly="true"/>
            </div>
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "报销金额"/>：
    </label>
        <div class="col-sm-8"><input name="reimburseMoney" value="${bpmErpPersonReimburse.reimburseMoney?default('')}" class="form-control" type="text"  readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "报销凭证"/>：
    </label>
        <div class="col-sm-8">

            <div class="layui-upload">
                <div class="layui-upload-list layui-upList-minHeight uploadpadding">
                    <table class="layui-table">
                        <thead>
                        <tr>
                            <th>文件名</th>
                            <th>大小</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody id="demojiazhaoList">
                        <tr id="upjiazhaoload"> </tr>
                        <#list proof as item>

                        <tr id="upload${item_index}">
                            <td>  ${item.fileName?default("")}  </td>
                            <td> ${item.fileSize?default("")}   </td>
                            <td>已上传</td>
                            <td>
                                <a class="btn btn-danger btn-sm" href="#" download="${item.url}" ><i class="fa fa-download"></i></a>
                            </td>
                        </tr>
                        </#list>
                        </tbody>
                    </table>
                </div>
            </div>

        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="reimburseRemark" class="form-control" readonly="true">${bpmErpPersonReimburse.reimburseRemark?default('')}</textarea>
        </div>
    </div>

    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "审批金额"/>：
    </label>
        <div class="col-sm-8"><input name="cashierApprovalMoney" value="${bpmErpPersonReimburse.cashierApprovalMoney?default('')}" class="form-control" type="text"  readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "出纳审批"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="cashierApproval" dictType="sys_crm_isOrNo" value="${bpmErpPersonReimburse.cashierApproval?default('')}" readOnly="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "出纳备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="cashierRemark" class="form-control" readonly="true">${bpmErpPersonReimburse.cashierRemark?default('')}</textarea>
        </div>
    </div>

    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "报销比例"/>：
    </label>
        <div class="col-sm-8"><input name="managerReimburseProportion" value="${bpmErpPersonReimburse.managerReimburseProportion?default('')}" class="form-control" type="text"  readonly="true">
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "报销金额"/>：
    </label>
        <div class="col-sm-8"><input name="managerReimburseMoney" value="${bpmErpPersonReimburse.managerReimburseMoney?default('')}" class="form-control" type="text"  readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "财务经理审批"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="managerApproval" dictType="sys_crm_isOrNo" value="${bpmErpPersonReimburse.managerApproval?default('')}" readOnly="true" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><@ctx.i18n text = "财务经理备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="managerRemark" class="form-control" readonly="true">${bpmErpPersonReimburse.managerRemark?default('')}</textarea>
        </div>
    </div>

    <#if bpmErpPersonReimburse.processStatus==3 >
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "会计审批人员"/>：
    </label>
        <div class="col-sm-8"><input class="form-control" type="text" value="${user.name}" readonly="true">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "会计审批"/>：</label>
        <div class="col-sm-8">
            <@form.radio name="accountingApproval" dictType="sys_crm_isOrNo" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "会计备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="accountingRemark" class="form-control" required></textarea>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "会计录入时间"/>：</label>
        <div class="col-sm-8">
            <div class="input-group date">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input class="form-control time-input" name="accountingCreateTime"  data-type="date" data-format="yyyy-MM-dd" type="text"  required/>
            </div>
        </div>
    </div>
</#if>
<#if bpmErpPersonReimburse.processStatus!=3 >
<div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "会计审批人员"/>：
</label>
    <div class="col-sm-8"><input value="${bpmErpPersonReimburse.accountingApprovalPerson?default('')}" class="form-control" type="text"  readonly="true">
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "会计审批"/>：</label>
    <div class="col-sm-8">
        <@form.radio name="accountingApproval" dictType="sys_crm_isOrNo" value="${bpmErpPersonReimburse.accountingApproval?default('')}" readOnly="true" />
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "会计备注"/>：</label>
    <div class="col-sm-8">
        <textarea name="accountingRemark" class="form-control" readonly="true">${bpmErpPersonReimburse.accountingRemark?default('')}</textarea>
    </div>
</div>

<div class="form-group">
    <label class="col-sm-3 control-label"><@ctx.i18n text = "会计录入时间"/>：</label>
    <div class="col-sm-8">
        <div class="input-group date">
            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
            <input class="form-control" name="accountingCreateTime"  data-type="date"   value="${(bpmErpPersonReimburse.accountingCreateTime?string('yyyy-MM-dd HH:mm:ss'))!}" data-format="yyyy-MM-dd" type="text"  readonly="true"/>
        </div>
    </div>
</div>
</#if>
</@form.form>
</div>
<@footer>
<script type="text/javascript">
    var prefix = baseURL + "erp/reimburse"
    $("#form-reimburse-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if (opt.validate.form()) {
            opt.operate.save(prefix + "/view4", $('#form-reimburse-add').serialize());
        }
    }
    function down(url){
        downLoadXls(url);
    }

    /**
     * 下载文件
     * @param url
     */
    function downLoadXls(url){
        var judgeDiv = document.getElementById("dwDiv");
        if(judgeDiv!=null){
            document.body.removeChild(judgeDiv);
        }
        var divObj = document.createElement("div");
        divObj.id="dwDiv";
        var aObj = document.createElement("a");
        aObj.href=encodeURI(url);
        aObj.id = "hrefFile";
        divObj.appendChild(aObj);
        document.body.appendChild(divObj);
        document.getElementById("hrefFile").click();
    }
</script>
</@footer>
</@pageTheme>